#ifndef FRIENDREQUEST_H
#define FRIENDREQUEST_H

#include <entity/friendinfo.h>
#include <entity/result.h>
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QJsonObject>

class Friendrequest : public QObject
{
    Q_OBJECT
public:

    explicit Friendrequest(QObject *parent = nullptr);

    void friendInformation(const int &id);

    void serchFriendByNickName(const int &search_id, const QString &search_name);

    QString getUri(const QString &url);

private slots:

    void onFinished(QNetworkReply *reply);

signals:

    void friendFinished(MyNamespace::Result<std::vector<FriendInfo>> ret);

    void serchFinished(QJsonObject obj);

private:
    QNetworkAccessManager *manager = nullptr;

    QString ip="8.130.86.186";

};

#endif // FRIENDREQUEST_H
